Skip to content

Fix date formatting on server for CSV export#29977

Merged
tsullivan merged 8 commits intoelastic:masterfrom
tsullivan:fix/reporting-csv-tz-ii
Feb 6, 2019
Merged

Fix date formatting on server for CSV export#29977
tsullivan merged 8 commits intoelastic:masterfrom
tsullivan:fix/reporting-csv-tz-ii

Conversation

@tsullivan
Copy link
Copy Markdown
Member

Summary

Closes #29463
Re-try #29781

Summarize your PR. If it involves visual changes include a screenshot or gif.

  • new createDateOnServerFormat field formatter type
    • This is pretty much a copy of createDateFormat, but this one treats the date as a value in UTC when it parses it

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
    • I'm still working on a test that generates a simple CSV and verifies the output. It might be a separate PR

@tsullivan tsullivan added review v7.0.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead v6.6.1 labels Feb 4, 2019
@tsullivan
Copy link
Copy Markdown
Member Author

tsullivan commented Feb 4, 2019

Reviewers: Let me know if you need to see a test added in this change. I think adding a new integration test that hits the CSV generation URL and then pulls the completed job out of ES might be the best option for now.

@tsullivan tsullivan force-pushed the fix/reporting-csv-tz-ii branch from 134f6c5 to 031846a Compare February 4, 2019 19:02
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@joelgriffith joelgriffith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one stray console.log and a few questions (probably just my lack of understanding)

}

if (date.isValid()) {
console.log({ date: date.format(this._memoizedPattern) });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray console?

});
}

getParamDefaults() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see this used elsewhere... is it an interface that this class implements?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not sure. I copied most of this file from src/legacy/core_plugins/kibana/common/field_formats/types/date.js. All the format types seem to have that method.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of "copied from", there are unrelated differences in the new file: _memoizedConverter is declared in the constructor instead of in _convert

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolio! Thanks for the clarifaction

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@tsullivan
Copy link
Copy Markdown
Member Author

@joelgriffith ready for another look

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@joelgriffith
Copy link
Copy Markdown
Contributor

Nice, LGTM

@tsullivan tsullivan merged commit 4a148e6 into elastic:master Feb 6, 2019
@tsullivan tsullivan deleted the fix/reporting-csv-tz-ii branch February 6, 2019 16:42
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 6, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 6, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 6, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
tsullivan added a commit to tsullivan/kibana that referenced this pull request Feb 6, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
tsullivan added a commit that referenced this pull request Feb 6, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
tsullivan added a commit that referenced this pull request Feb 7, 2019
* Fix date formatting on server for CSV export

* remove stray console.log

* allow async to act in parallel

* Log a warning when "Browser" is the timezone
@bhavyarm
Copy link
Copy Markdown
Contributor

@tsullivan this is PR is failing in 6.6.1 BC1. Here is the regression bug: #31131

@tsullivan
Copy link
Copy Markdown
Member Author

@bhavyarm Apologies! This incorrectly has the 6.6.1 label. It is not a regression, and is fixed in 7.0+

@tsullivan
Copy link
Copy Markdown
Member Author

I fixed the version labels. The fix is for 7.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review v7.0.0 v7.2.0 v8.0.0 zDeprecated Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants